<?php
include('../incsession.php');

if(isset($_POST['topic'])){
	$_SESSION['topic']=$_POST['topic'];
	header("location: sys_intro.php");
}


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>選擇主題</title>
<link rel="stylesheet" href="style.css" type="text/css" media="screen">
</head>

<body onLoad="TimeCountDown()">
<div id="wrapper">
	<div id="header">
		<div id="logo"></div>
		<div id="menu">
        <?php
			include("menu.php");
		?>
		</div>
	</div>
	<div class="clearer"></div>
	<div class="edge-top"></div>

	<div id="main">

		<div id="title">選擇主題<font size=4><br>請選擇一個你想要學習的主題</font></div>
<hr/><br><br>

<!-- 內文開始 !-->
<?php
//$query = "SELECT * FROM topic WHERE from_date < DATE_ADD(NOW(),INTERVAL 8 HOUR) and to_date > DATE_ADD(NOW(),INTERVAL 8 HOUR)
//								AND topicid IN (SELECT topicid FROM topic_class WHERE classid=".$_SESSION['class'].")";

$query = "SELECT * FROM topic";
$result = mysql_query($query,$orcp_con) or die ('Error in query');


$i = 0;
if(mysql_num_rows($result)!=0){
	echo '<form method = POST action="topic.php" >';
	$row = mysql_fetch_array($result);
	echo "<Input type = 'Radio' Name ='topic' value='".$row['topicid']."' checked>".$row['name']."<br>";	
	$i++;

	while($row = mysql_fetch_array($result)){
		echo "<Input type = 'Radio' Name ='topic' value='".$row['topicid']."'>".$row['name']."<br>";	
		$i++;
	}
	echo '</br><div class="btn_right"><input type="submit" value = "下一步 >> 系統與課程介紹"></div></form>';
}
else{
	echo "目前沒有測驗<br><br>";
	echo "<form action='../index.php' method=POST>";
	echo "<div class='btn_right'><input type='submit' value = '回到選單'></div></form>";
}

?>

<!-- 內文結束 !-->

	</div>
    <div class="edge-bottom"></div>
    <div id="footer"><?php  include("footer.php"); ?></div>
</div>


<!--
<div id="association">&nbsp;association</div>
<div id="voc_cart">&nbsp;vocabulary cart</div> 
!-->
</body>
</html>